package cn.edu.tsinghua.xkk.DAO;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class BasicDAO {
	
	static String  dbDriver="com.microsoft.sqlserver.jdbc.SQLServerDriver";
    static String  dbUrl="jdbc:sqlserver://192.168.50.4\\SQLEXPRESS:1433;DatabaseName=XKK;user=sa;password=12341234;";
    
    public static Connection getConnection()
    {
    	
	    try{
	    	Class.forName(dbDriver);
	    	Connection dbConnection=DriverManager.getConnection(dbUrl);
	    	return dbConnection;
	    	//System.out.println("hello db!");
	       }   
	     catch(Exception e)
	     {   
	    	 e.printStackTrace();
	    	 return null;
	     }
	     
    }
	

}
